<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<title>充值</title>
<script src="__PUBLIC__/js2/jquery-1.8.3.min.js"></script>
<script src="__PUBLIC__/js2/wb.js"></script>
<link href="__PUBLIC__/css2/public.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/css2/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
	<div class="top-bar">充值缴费</div>
	<div class="nom-title">充值金额</div>
	<div class="contbar x1mu1">
		<div class="cz">
			<a href="javascript:void(0);" class="xz">100</a>
			<a href="javascript:void(0);">200</a>
			<a href="javascript:void(0);">300</a>
			<a href="javascript:void(0);">500</a>
			<a href="javascript:void(0);">1000</a>
			<a href="javascript:void(0);">其他</a>
		</div>
	</div>
	<div id="other" style="display: none;">
		<div class="nom-title">其他金额</div>
		<div class="contbar">
			<ul>
				<li style="border-bottom: 0px;"><input type="text" id="point" name="point" placeholder="输入充值金额" /></li>
			</ul>
		</div>
	</div>
	<a href="javascript:void(0);" class="btn2 weixin" >微信</a>
	<a href="javascript:void(0);" class="btn2 alipay" style="background-color: #f0ad4e" >支付宝</a>
	<a href="index.html" class="btn2" style="background-color: #f0ad4e">返回</a>
	<script>
		$(document).ready(function(){
			$(".cz a").on('click', function(){
				var obj = $(this);
				var point = obj.html();
				$(".cz a").removeClass('xz');
				obj.addClass('xz');
				
				if(point == '其他'){
					$("#other").show();
				}else{
					$("#point").val('');
					$("#other").hide();
				}
			});
			
			$(".weixin").on('click', function(){
				var point = 0;
				var xz = $("a.xz").html();
				if(xz == "其他"){
					point = $("#point").val() || 0;
				}else{
					point = xz/1;
				}
				
				if(point/1 <= 0){
					return;
				}
				
				var urls = "http://mamagy.com/xj/wap/wxpay.html?point="+ point;
				window.location.href = urls;
			});
		});

		function jsApiCall(jsApiParameters)
        {
            WeixinJSBridge.invoke('getBrandWCPayRequest',jsApiParameters,function(res){
                    WeixinJSBridge.log(res.err_msg);
                    alert(res.err_code+res.err_desc+res.err_msg);
                }
            );
        }

        function callpay()
        {
            if (typeof WeixinJSBridge == "undefined"){
                if( document.addEventListener ){
                    document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                }else if (document.attachEvent){
                    document.attachEvent('WeixinJSBridgeReady', jsApiCall); 
                    document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                }
            }else{
                jsApiCall();
            }
        }

	</script>
</body>
</html>
